# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ignacio Galmarino <igalmarino@gmail.com>

pkgname=openresolv
pkgver=3.9.0
pkgrel=1
pkgdesc="resolv.conf management framework (resolvconf)"
arch=(any)
url="https://roy.marples.name/projects/openresolv"
license=('custom:BSD')
backup=(etc/resolvconf.conf)
provides=(resolvconf)
depends=(bash)
makedepends=(systemd)
source=("https://roy.marples.name/downloads/openresolv/${pkgname}-${pkgver}.tar.xz"
        fs33801.patch)
sha256sums=('51a04d39232bb797c9efeaad51a525cf50a1deefcb19a1ea5dd3475118634db8'
            '466678996689463af748bcdce7ea6f9f24f59004fa4db61fdc04da9f5fff2a6a')

prepare() {
  cd $pkgname-$pkgver
  patch -Np1 -i ../fs33801.patch
  sed -n '2,25{s:^# \?::;p}' resolvconf.in >LICENSE 
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib/resolvconf --sbindir=/usr/bin
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install

  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
